<template>
    <div class="box">
        <p class="title">会议室</p>
        <div class="btn-group">
            <div class="btn-svg-desc">
                <div class="join-meeting meeting-btn">
                    <n-icon size="60" @click="toRoomInfo('joinr')">
                        <svg-icon name="joinmeeting"></svg-icon>
                    </n-icon>
                </div>
                <b class="btn-desc">加入会议</b>
            </div>
            <div class="btn-svg-desc">
                <div class="host-meeting meeting-btn">
                    <n-icon size="60" @click="toRoomInfo('host')">
                        <svg-icon name="hostmeeting"></svg-icon>
                    </n-icon>
                </div>
                <b class="btn-desc">新建会议</b>
            </div>

        </div>

    </div>
</template>

<script setup>
import { useRouter } from 'vue-router'
import { useStore } from 'vuex'
const router = useRouter()
const store = useStore()

// 前往填写会议室信息页
function toRoomInfo(identity) {
    // 如果是主持人则把是主持人的状态保存到vuex中供后续使用
    store.commit('meeting/SET_ISROOMHOST', identity === 'host' ? true : false)
    router.push('/meeting/room-info', { query: identity })
}
</script>
<style lang="scss" scoped>
.box {
    width: 600px;
    height: 400px;
    background-color: #fff;
    padding: 20px;
    box-sizing: border-box;
    box-shadow: rgba(0, 0, 0, 0.1) 0px 4px 12px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);

    .title {
        font-size: 24px;
        font-weight: bold;
        margin-bottom: 100px;
    }

    .btn-group {
        display: flex;
        align-items: center;
        justify-content: space-around;

        .btn-svg-desc {
            display: flex;
            flex-direction: column;
            align-items: center;

            .btn-desc {
                padding-top: 15px;
                font-weight: bold;
            }

            .meeting-btn {
                width: 100px;
                height: 100px;
                border-radius: 50%;
                display: flex;
                align-items: center;
                justify-content: center;

                i {
                    &:hover {
                        cursor: pointer;
                    }
                }
            }

            .host-meeting {
                background-color: rgba(24, 160, 88, 0.16);
            }

            .join-meeting {
                background-color: rgba(32, 128, 240, 0.16);
            }
        }
    }
}
</style>